import logging,yagmail  #导入日志和邮件
#采集日志方法
def log_set():
    logging.basicConfig(filename="serviceplatformlog.txt",filemode="w+",level=logging.DEBUG,format='%(filename)s -> %(levelno)s -> %(asctime)s -> %(message)s')

#发送邮件
def send_mail(filepath):
    mail = yagmail.SMTP(user="2930885223@qq.com",password="ilarvpztxodrdgha",host="smtp.qq.com")
    mail.send(to="2930885223@qq.com",subject="综合服务平台新增代理商接口测试报告",contents="8.12测试报告已完成，请您查收",attachments=filepath)